<!DOCTYPE HTML>
<html>
<!--
    author: ThinkerDev in BaoShanJie.Com
    project: 宝善街微型协作系统
    group：宝善街【技术部】
-->
<head>
	<title>工作内容添加 - By 宝善街技术部</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="宝善街微型工作协作系统,ThinkerDev作品" />
	<link rel="stylesheet" href="__CSS__bootstrap.min.css" type="text/css" />
    <link href="__CSS__bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
	<style>
	    *{font-family:"Microsoft YaHei"}
        .error{color: #ff6b64;/* JQ验证后标红 */}
	</style>
</head>

<body>
<head>
<nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" style="cursor:default;">宝善街微型协作</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#" class="hidden">登陆</a></li>
        <li><a href="{:U('index/view')}">查阅任务</a></li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>	
</head>
<div class="container">
<div class="page-header">
  <h1>新建任务单 <small> New</small></h1>
</div>
<div style="max-width:760px;">
	<form method="post" action="__SELF__" id="taskform">
		<div class="row">
          <div class="col-md-12"><input type="text" class="form-control" placeholder="发起人，请填入【姓名+部门】" name="post_user"></div>
            <div style="padding: 2px 0px;">&nbsp;</div>
		  <div class="col-md-12"><input type="text" class="form-control" placeholder="项目名称" name="project_name"></div>
		  	<div style="padding: 2px 0px;">&nbsp;</div>
		  <div class="col-md-12">
              <textarea style="height:200px; max-width:760px;"class="form-control" placeholder="填写项目正文" name="project_text"></textarea>
          </div>
		  	<div style="padding: 2px 0px;">&nbsp;</div>
		  <div class="col-md-6">
              <div class="form-group">
                  <div class="input-group date form_date col-md-5" data-date="" data-date-format="yyyy-mm-dd" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                      <input style="width: 285px;" class="form-control" type="text" readonly placeholder="任务开始日期" name="project_start"/>
                      <span class="input-group-addon"><span class="glyphicon glyphicon-remove" title="重置日期" alt="重置日期"></span></span>
                      <span class="input-group-addon"><span class="glyphicon glyphicon-calendar" title="选取日期" alt="选取日期"></span></span>
                  </div>
                  <input type="hidden" id="dtp_input2" value="" /><br/>
              </div>
		  </div>
		  <div class="col-md-6">
              <div class="form-group">
                  <div class="input-group date form_date col-md-5" data-date="" data-date-format="yyyy-mm-dd" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                      <input style="width: 285px;" class="form-control" type="text" readonly placeholder="任务结束日期" name="project_end"/>
                      <span class="input-group-addon"><span class="glyphicon glyphicon-remove" title="重置日期" alt="重置日期"></span></span>
                      <span class="input-group-addon"><span class="glyphicon glyphicon-calendar" title="选取日期" alt="选取日期"></span></span>
                  </div>
                  <input type="hidden" id="dtp_input2" value="" /><br/>
              </div>
		  </div>
		  	<div style="padding: 2px 0px;">&nbsp;</div>
		  <div class="col-md-6">&nbsp;</div>
		  <div class="col-md-6"><input type="submit" class="btn btn-primary pull-right" value="提交任务" ></div>
		</div>
	</form>
</div>
</div>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__bootstrap.js"></script>
<script type="text/javascript" src="__JS__bootstrap-wysiwyg.js"></script>
<script type="text/javascript" src="__JS__bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="__JS__bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript" src="__JS__jquery.validate.js"></script>
<script language="javascript" type="text/javascript">
    $(document).ready(function()
    {
        $("#taskform").validate({
            debug: true,
            rules:
            {
                project_name: { required:true },
                project_text: { required:true,minlength:10 },
                project_start: { required:true },
                project_end: { required:true },
                post_user:{required:true}
            },
            messages:
            {
                project_name: { required: "任务名未填写" },
                project_text: { required: "请描述工作内容" ,minlength:"描述内容过于少，请详细描述！"},
                project_start: { required: "选择一个起始时间" },
                project_end: { required: "我们需要一个结束时间！" },
                post_user:{required:"任务发起人未填写"},
                Countries: { required:"有多个必填项目未填写，请填入！" }
            },/*,
            errorClass: 'danger',
            showErrors: function(errorMap, errorList) {
                alert("Your form contains "
                        + this.numberOfInvalids()
                        + " errors, see details below.");
            },*/
            submitHandler: function(form) {
                // 表单提交 不可使用 $(form).submit() 而是 以下。。。。。。我靠，擦你大爷的教程
                form.submit();
            }
        });
    });
$('.form_date').datetimepicker({
    language:  'zh-CN',
    weekStart: 1,
    todayBtn:  1,
    autoclose: 0,
    todayHighlight: 1,
    startView: 2,
    minView: 2,
    forceParse: 0
});
</script>
</body>
</html>